package model.forview;

import models.ConstantName;
import models.ConstantValue;

public class TypeCreateModelForView extends ContentForMainTemplate
{
    public String title;
    public String description;
    public String type_name;
    public String type_title;
    
    public String titleLabel;
    public String descriptionLabel;
    
    public String saveButton;
    public String cancelButton;
    public String addButton;
    
    public final String titleName = "title";
    public final String descriptionName = "description";
    public final String type_nameName = "type_name";
    public final String type_titleName = "type_title";    
    
    public TypeCreateModelForView()
    {
	setDefaultValues();
    }
    
    protected void setDefaultValues()
    {
	String title = ConstantValue
		.getConstantValue(ConstantName.TYPE_CREATE_PAGE_TITLE);
	String header = ConstantValue
		.getConstantValue(ConstantName.TYPE_CREATE_PAGE_HEADER);
	String footer = ConstantValue
		.getConstantValue(ConstantName.TYPE_CREATE_PAGE_FOOTER);
	String userName = "";
	
	title = title != null ? title : "Создание нового типа данных";
	header = header != null ? header : "Создание ногого типа данных";
	footer = footer != null ? footer : "Создание новго типа данных";
	
	titleLabel = ConstantValue.getConstantValue(ConstantName.TYPE_CREATE_PAGE_TITLE_LABEL);
	descriptionLabel = ConstantValue.getConstantValue(ConstantName.TYPE_CREATE_PAGE_DESCRIPTION_LABEL);
	saveButton = ConstantValue.getConstantValue(ConstantName.SAVE_BUTTON);
	cancelButton = ConstantValue.getConstantValue(ConstantName.CANCEL_BUTTON);
	addButton = ConstantValue.getConstantValue(ConstantName.TYPE_CREATE_PAGE_BUTTON_ADD_FIELD);
	
	titleLabel = titleLabel != null ? titleLabel : "Title";
	descriptionLabel = descriptionLabel != null ? descriptionLabel : "Description";
	saveButton = saveButton != null ? saveButton : "Save";
	cancelButton = cancelButton != null ? cancelButton : "Cancel";
	addButton = addButton != null ? addButton : "Add field";
	
	mainModelForView = new MainModelForView(title, userName, header, footer);	
    }
    
}
